<?php
function dbcon(){
	include("config.php");
	$dbHandle = mysql_connect("$dbserver","$dbuser","$dbpass");

	if ($dbHandle == False) {
		print ("can not connect db\n");
		print ("<br><a href=javascript:history.back()>Back</a><br>");
		exit;
	}

	mysql_select_db("$dbname");

	$sql = "SET NAMES UTF8";
	$rs = mysql_query($sql);

	$sql = "set character set utf8";
	$rs = mysql_query($sql);

}

function dbclose(){
	include("config.php");
	$dbHandle = mysql_connect("$dbserver","$dbuser","$dbpass");

	mysql_close($dbHandle);
}

?>